import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "",
    component: Home,
    component: () => import("../views/layout.vue"),
    redirect: "Home",
    children: [
      {
        path: "/Home",
        name: "Home",
        component: () => import("../views/Home.vue"),
      },
      {
        path: "/start",
        name: "start",
        component: () => import("../views/start.vue"),
      },
      {
        path: "/login",
        name: "login",
        component: () => import("../views/login.vue"),
      },
      {
        path: "/fuxi",
        name: "fuxi",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/fuxi.vue"),
        // meta: {
        //   isFootShow: true,
        // },
        meta: { title: "复习" }
      },
      {
        path: "/header",
        name: "header",
        component: () => import("../components/header.vue"),
      },
      
      {
        path: "/xxziliao",
        name: "xxziliao",
        component: () => import("../views/xxziliao.vue"),
        meta: { title: "学习资料" }
      },
      {
        path: "/kcxiangqing",
        name: "kcxiangqing",
        component: () => import("../views/kcxiangqing.vue"),
        meta: { title: "课程详情" }
      },
      {
        path: "/mine",
        name: "mine",
        component: () => import("../views/mine.vue"),
        // meta: {
        //   isFootShow: true,
        // },
      },
      {
        path: "/news",
        name: "news",
        component: () => import("../views/news.vue"),
        meta: { title: "系统消息" }
      },
      {
        path: "/newsdetail/:id",
        name: "newsdetail",
        component: () => import("../views/newsdetail.vue"),
        meta: { title: "消息详情" }
      },
      {
        path: "/kalendar",
        name: "kalendar",
        component: () => import("../views/kalendar.vue"),
        meta: { title: "学习日历" }
      },
      {
        path: "/report",
        name: "report",
        component: () => import("../views/report.vue"),
      },
      {
        path: "/biji",
        name: "biji",
        component: () => import("../views/biji.vue"),
      },
      {
        path: "/profile",
        name: "profile",
        component: () => import("../views/myconter/profile.vue"),
        meta: { title: "个人信息" }
      },
      {
        path: "/modify_num",
        name: "modify_num",
        component: () => import("../views/myconter/modify_num.vue"),
        meta: { title: "修改手机号" }
      },
      {
        path: "/update",
        name: "update",
        component: () => import("../views/myconter/update.vue"),
        meta: { title: "版本更新" }
      },
      {
        path: "/connectus",
        name: "connectus",
        component: () => import("../views/myconter/connectus.vue"),
        meta: { title: "联系我们" }
      },
      {
        path: "/aboutus",
        name: "aboutus",
        component: () => import("../views/myconter/aboutus.vue"),
        meta: { title: "关于我们" }
      },
      {
        path: "/group",
        name: "group",
        component: () => import("../views/myconter/group.vue"),
        meta: { title: "详情" }
      },
      {
        path: "/myteacher",
        name: "myteacher",
        component: () => import("../views/myconter/myteacher.vue"),
        meta: { title: "我的老师" }
      },
      {
        path: "/integral",
        name: "integral",
        component: () => import("../views/myconter/integral.vue"),
        meta: { title: "我的积分" }
      },
      {
        path: "/myusername",
        name: "myusername",
        component: () => import("../views/myconter/myusername.vue"),
        meta: { title: "用户名" }
      },
      {
        path: "/set",
        name: "set",
        component: () => import("../views/myconter/set.vue"),
        meta: { title: "设置" }
      },
      {
        path: "/remind",
        name: "remind",
        component: () => import("../views/myconter/remind.vue"),
        meta: { title: "课程提醒" }
      },
      {
        path: "/errorsben",
        name: "errorsben",
        component: () => import("../views/myconter/errorsben.vue"),
        meta: { title: "错题本" }
      },
      {
        path: "/share",
        name: "share",
        component: () => import("../views/myconter/share.vue"),
        meta: { title: "邀请好友" }
      },
      
      {
        path: "/addAddress",
        name: "addAddress",
        component: () => import("../views/myconter/addAddress.vue"),
        meta: { title: "添加地址" }
      },
      {
        path: "/addTeacher",
        name: "addTeacher",
        component: () => import("../views/myconter/addTeacher.vue"),
        meta: { title: "添加二维码" }
      },
      {
        path: "/shop",
        name: "shop",
        component: () => import("../views/shop.vue"),
        meta: { title: "积分商城" }
      },
      {
        path: "/shopInfo",
        name: "shopInfo",
        component: () => import("../views/shopInfo.vue"),
        meta: { title: "商品详情" }
      },
      {
        path: "/record",
        name: "record",
        component: () => import("../views/record.vue"),
        meta: { title: "兑换记录" }
      },
      {
        path: "/studyReport",
        name: "studyReport",
        component: () => import("../views/studyReport.vue"),
        meta: { title: "学习报告" }
      },
      {
        path: "/evaluate",
        name: "evaluate",
        component: () => import("../views/myconter/evaluate.vue"),
        meta: { title: "课程评价" }
      },
      {
        path: "/jisuan",
        name: "jisuan",
        component: () => import("../views/jisuan.vue"),
        meta: { title: "结算" }
      },
      {
        path: "/recorddetail",
        name: "recorddetail",
        component: () => import("../views/recorddetail.vue"),
        meta: { title: "兑换详情" }
      },
      {
        path: "/fenxiao",
        name: "fenxiao",
        component: () => import("../views/fenxiao.vue"),
        meta: { title: "邀请好友" }
      },
      {
        path: "/rule",
        name: "rule",
        component: () => import("../views/rule.vue"),
        meta: { title: "规则详情" }
      },
      {
        path: "/shouyi",
        name: "shouyi",
        component: () => import("../views/shouyi.vue"),
        meta: { title: "我的收益明细" }
      },
      {
        path: "/list",
        name: "list",
        component: () => import("../views/list.vue"),
        meta: { title: "客户列表" }
      },
      {
        path: "/tixian",
        name: "tixian",
        component: () => import("../views/tixian.vue"),
        meta: { title: "我的提现明细" }
      },
      {
        path: "/card",
        name: "card",
        component: () => import("../views/card.vue"),
        meta: { title: "我的银行卡" }
      },
      {
        path: "/addCard",
        name: "addCard",
        component: () => import("../views/addCard.vue"),
        meta: { title: "添加银行卡" }
      },
      {
        path: "/money",
        name: "money",
        component: () => import("../views/money.vue"),
        meta: { title: "提现" }
      },
      {
        path: "/yinsi",
        name: "yinsi",
        component: () => import("../views/yinsi.vue"),
        meta: { title: "隐私协议" }
      },
    ]
    // meta: {
    //   isFootShow: true,
    // },
  },
  
  {
    path: "/address",
    name: "address",
    component: () => import("../views/myconter/address.vue"),
    meta: { title: "我的地址" }
  },
  {
    path: "/mycourses",
    name: "mycourses",
    component: () => import("../views/myconter/mycourses.vue"),
    meta: { title: "购买课程" }
  },
  {
    path: "/wx",
    name: "wx",
    component: () => import("../views/wx.vue"),
    meta: { title: "慧学记" }
  },
  {
    path: "/dakaH5",
    name: "dakaH5",
    component: () => import("../views/dakaH5.vue"),
    meta: { title: "慧学记" }
  },
  
];

const router = new VueRouter({
  mode:'hash',
  base:process.env.BASE_URL,
  routes,
});
const VueRouterPush = VueRouter.prototype.push 
VueRouter.prototype.push = function push (to) {
    return VueRouterPush.call(this, to).catch(err => err)
}
export default router;
